namespace CSharpPro._0925;

public class Demo
{
    // 作业一
    public void TestPrint2(int startYear, int endYear)
    {
        for (int year = startYear; year <= endYear; year++)
        {
            if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
            {
                Console.WriteLine($"{year}年是闰年");
            }
        }
    }
}
public class TravelPriceCalc //作业二
{
    public double GetPrice(int month, string transport)
    {
        switch (transport)
        {
            case "原价": return 8800;
            case "航班": return month >=5 && month <=10 ? 0.9*8800 : 0.6*8800;
            case "动车": return month >=5 && month <=10 ? 0.75*8800 : 0.3*8800;
            default: return 0;
        }
    }
}
